On the Generation of Test Data for Prolog by Partial Evaluation
نویسندگان
چکیده
In recent work, we have proposed an approach to Test Data Generation (TDG) of imperative bytecode by partial evaluation (PE) of CLP which consists in two phases: (1) the bytecode program is first transformed into an equivalent CLP program by means of interpretive compilation by PE, (2) a second PE is performed in order to supervise the generation of test-cases by execution of the CLP decompiled program. The main advantages of TDG by PE include flexibility to handle new coverage criteria, the possibility to obtain test-case generators and its simplicity to be implemented. The approach in principle can be directly applied for TDG of any imperative language. However, when one tries to apply it to a declarative language like Prolog, we have found as a main difficulty the generation of test-cases which cover the more complex control flow of Prolog. Essentially, the problem is that an intrinsic feature of PE is that it only computes non-failing derivations while in TDG for Prolog it is essential to generate test-cases associated to failing computations. Basically, we propose to transform the original Prolog program into an equivalent Prolog program with explicit failure by partially evaluating a Prolog interpreter which captures failing derivations w.r.t. the input program. Another issue that we discuss in the paper is that, while in the case of bytecode the underlying constraint domain only manipulates integers, in Prolog it should properly handle the symbolic data manipulated by the program. The resulting scheme is of interest for bringing the advantages which are inherent in TDG by PE to the field of logic programming.
منابع مشابه
Concolic Execution and Test Case Generation in Prolog
Symbolic execution extends concrete execution by allowing symbolic input data and then exploring all feasible execution paths. It has been defined and used in the context of many different programming languages and paradigms. A symbolic execution engine is at the heart of many program analysis and transformation techniques, like partial evaluation, test case generation or model checking, to nam...
متن کاملPolymorphic Type Checking with Subtypes in Prolog
In this paper, we give an executable specification of a state-of-the-art polymorphic type checking system with subtypes in Prolog. We show that the implementation reduces to modifying simple well-known rectainterpreters into type meta-interpreters and applying the so-called generate-and-test approach to programming in Prolog. This study emphasizes that Prolog is suitable as a language for defin...
متن کاملEffect of Antibiotics and/or Chemotherapy on Generation of Reactive Oxygen Intermediate by Neutrophils
Dear Editor, The O2-generating enzyme NADPH oxidase, plays a crucial role in host defense against microbial infection through the production of reactive oxygen species (ROS).1The multisubunit NADPH oxidase complex can be detected in vitro by the nitroblue tetrazolium test (NBT).2The NBT test is used for the diagnosis of chronic granulomatous disease.3 However, several factors, such as some cyto...
متن کاملEvaluation of patients’ awareness regarding proper maintenance of removable partial prostheses
Background and Aims: Removable partial denture (RPD) is a common treatment to restore partially edentulous areas; however, a limited number of studies have been made on oral hygiene habits among patients with RPD. The aim of this study was to evaluate the patients’ knowledge about various cleaning methods of RPD to consciously improve hygienic habits of the patients. Materials and Methods: Thi...
متن کاملPrologCheck - Property-Based Testing in Prolog
We present PrologCheck, an automatic tool for propertybased testing of programs in the logic programming language Prolog with randomised test data generation. The tool is inspired by the well known QuickCheck, originally designed for the functional programming language Haskell. It includes features that deal with specific characteristics of Prolog such as its relational nature (as opposed to Ha...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- CoRR
دوره abs/0903.2199 شماره
صفحات -
تاریخ انتشار 2009